<?php
namespace Home\Controller;
use Think\Controller;
use Think\Auth;
class BaseController extends Controller {
	public function _initialize(){
		session_start();
		$uid=$_SESSION["uid"];
		$Auth = new Auth();
		 //需要验证的规则列表,支持逗号分隔的权限规则或索引数组
		 $name = MODULE_NAME . '/'.CONTROLLER_NAME.'/' . ACTION_NAME;
//		 var_dump($name);
//		 当前用户id
		 if (!$Auth->check($name, $uid)) {
		 	$this->assign("errorJumpUrl","/home/index/login");
		 	$this->assign("errorWaitSecond",3);
		 	$this->error();
		 }
	}
}
?>